package com.easy.bean;
import java.util.Date;

import com.easy.generator.annotation.EasyCascade;
import com.easy.generator.annotation.EasyField;
import com.easy.generator.annotation.FieldType;
import com.easy.generator.annotation.RouterLabel;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
@Data
@TableName("course")
@RouterLabel(label="课程管理")
public class Course {
    @TableField(value= "id")
    private Integer id;
    @EasyField(label = "课程名称")
    @TableField(value= "name")
    private String name;

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @TableField(value= "time")
    @EasyField(label = "课程时间",type= FieldType.Date)
    private Date time;
    @TableField(value= "length")
    @EasyField(label = "课程时长")
    private Integer length;
    @TableField(value= "max_count")
    @EasyField(label = "最大人数")
    private Integer maxCount;
    @TableField(value= "room")
    @EasyField(label = "教室")
    private String room;
    @TableField(value= "photo")
    @EasyField(label = "照片",type = FieldType.Image)
    private String photo;
    @TableField(value= "coach_id")
    private Integer coachId;
    @TableField(exist = false)
    @EasyField(show = true,insert = true,type = FieldType.Select,search = true,label = "教练")
    @EasyCascade(cascade = Coach.class,field = "id",cascadeField = "coachId",showField = "name")
    private Coach coach;
}
